﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="edit.aspx.cs" Inherits="AnyOffice.general.system.qikan.edit" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>编辑目录</title>
		
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		<script language="javascript" src="/aspnet_client/core/function.js"></script>
		<script Language="JavaScript">
function CheckForm()
{
   if(document.Form1.txtName.value=="")
   { alert("目录名称不能为空！");
     return (false);
   }

   if(document.Form1.ddlType.value=="2" && document.Form1.PostDeptId.value=="")
   {
	 alert("请指定部门！");
     return (false);
   }
   
    if(document.Form1.ddlType.value=="3" && document.Form1.AccessUserId.value=="")
   {
	 alert("请指定人员！");
     return (false);
   }

   return (true);
}

function select_type()
{
   if (Form1.ddlType.value=="1")
   {
       trDept.style.display='none';
       trUser.style.display='none';
    }
   else if (Form1.ddlType.value=="2")
   {
       trDept.style.display='';       
       trUser.style.display='none';
    }
   else if (Form1.ddlType.value=="3")
   {
       trDept.style.display='none';
       trUser.style.display='';
    }
}
		</script>
	</HEAD>
	<body class="bodycolor" topMargin="5">
		<form id="Form1" method="post" runat="server">
         <div class="main_div">
			<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
				<tr>
					<td class="Big"><img src="/images/menu/knowledge.gif" WIDTH="20" HEIGHT="20" align="absMiddle"><span class="big3">
							编辑期刊目录</span>
					</td>
				</tr>
			</table>
			<br>
			<asp:Panel id="pnlMain" runat="server">
				<TABLE class="tab_pub" cellSpacing="0" cellPadding="0" width="650" align="center" 
					border="0">
					<TR>
						<TD class="ta_bg" noWrap>目录名称：</TD>
						<TD class="ta_txt"><INPUT class="BigInput" id="txtName" type="text" size="30" name="txtName" runat="server">
						</TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>开放范围：</TD>
						<TD class="ta_txt"><SELECT class="BigSelect" id="ddlType" onChange="select_type()" name="ddlType" runat="server">
								<OPTION value="1">全体</OPTION>
								<OPTION value="2">指定部门</OPTION>
								<OPTION value="3">指定人员</OPTION>
							</SELECT>
						</TD>
					</TR>
					<TR id="trDept" style="DISPLAY: none">
						<TD class="ta_bg" noWrap>选择部门（对指定部门开放）：</TD>
						<TD class="ta_txt"><INPUT id="PostDeptId" type="hidden" name="PostDeptId" runat="server">
							<TEXTAREA class="BigStatic fl" id="PostDeptName" name="PostDeptName" rows="2" readOnly cols="30"
								runat="server"></TEXTAREA>
								<INPUT class="bnt_Add fl" style="width:50px; display:inline-table;" title="添加部门" onClick="dept_select('PostDeptId','PostDeptName','true');"
								type="button" value="添加" name="button">
								<INPUT class="bnt_Del fl" style="width:50px; display:inline-table;" title="清空部门" onClick="clear_double('PostDeptId','PostDeptName');"
								type="button" value="清空" name="button">
						</TD>
					</TR>
					<TR id="trUser" style="DISPLAY: none">
						<TD class="ta_bg" noWrap>选择人员（对指定人员开放）：</TD>
						<TD class="ta_txt"><INPUT id="AccessUserId" type="hidden" name="AccessUserId" runat="server">
							<TEXTAREA class="BigStatic fl" id="AccessUserName" name="AccessUserName" rows="2" readOnly cols="50"
								runat="server"></TEXTAREA>
								<INPUT class="bnt_Add fl" style="width:50px; display:inline-table;" title="添加人员" onClick="user_select('AccessUserId','AccessUserName');"
								type="button" value="添加" name="button">
								<INPUT class="bnt_Del fl" style="width:50px; display:inline-table;" title="清空人员" onClick="clear_double('AccessUserId','AccessUserName');"
								type="button" value="清空" name="button"></TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>
                            默认权限：</TD>
						<TD class="ta_txt">
                            <asp:CheckBoxList ID="ckblDefaultPriv" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Value="FileRead">阅读</asp:ListItem>                                                               
                                <asp:ListItem Value="FilePrint">打印</asp:ListItem>
                                <asp:ListItem Value="FileCopy">复制</asp:ListItem>
                                <asp:ListItem Value="FileDownload">下载</asp:ListItem>
                            </asp:CheckBoxList></TD>
					</TR>
					
					<TR>
						<TD class="ta_bg" noWrap>
                            新建权限：</TD>
						<TD class="ta_txt"><INPUT id="NewUserId" type="hidden" name="NewUserId" runat="server">
							<TEXTAREA class="BigStatic fl" id="NewUserName" name="NewUserName" rows="2" readOnly cols="50"
								runat="server"></TEXTAREA>
								<INPUT class="bnt_Add fl" style="width:50px; display:inline-table;" title="添加人员" onClick="user_select('NewUserId','NewUserName');" type="button" value="添加"
								name="button">
								<INPUT class="bnt_Del fl" style="width:50px; display:inline-table;" title="清空人员" onClick="clear_double('NewUserId','NewUserName');" type="button" value="清空"
								name="button">
                            <br>有权限的人可以上传文件和新建文件夹
								</TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>
                            阅读/打印权限：</TD>
						<TD class="ta_txt"><INPUT id="ReadUserId" type="hidden" name="ReadUserId" runat="server">
							<TEXTAREA class="BigStatic fl" id="ReadUserName" name="ReadUserName" rows="2" readOnly cols="50"
								runat="server"></TEXTAREA>
								<INPUT class="bnt_Add fl" style="width:50px; display:inline-table;" title="添加人员" onClick="user_select('ReadUserId','ReadUserName');" type="button" value="添加"
								name="button">
								<INPUT class="bnt_Del fl" style="width:50px; display:inline-table;" title="清空人员" onClick="clear_double('ReadUserId','ReadUserName');" type="button" value="清空"
								name="button"><br />
                            <asp:CheckBoxList ID="ckblReadPriv" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Value="FilePrint">打印</asp:ListItem>
                                <asp:ListItem Value="FileCopy">复制</asp:ListItem>
                            </asp:CheckBoxList>
                            有权限的人可以在线阅读或打印Office文档
                            </TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>
                            编辑权限：</TD>
						<TD class="ta_txt"><INPUT id="EditUserId" type="hidden" name="EditUserId" runat="server">
							<TEXTAREA class="BigStatic fl" id="EditUserName" name="EditUserName" rows="2" readOnly cols="50"
								runat="server"></TEXTAREA>
								<INPUT class="bnt_Add fl" style="width:50px; display:inline-table;" title="添加人员" onClick="user_select('EditUserId','EditUserName');" type="button" value="添 加"
								name="button">
								<INPUT class="bnt_Del fl" style="width:50px; display:inline-table;" title="清空人员" onClick="clear_double('EditUserId','EditUserName');" type="button" value="清 空"
								name="button">
                            <br>有权限的人可以在线编辑Office文档
								</TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>
                            下载权限：</TD>
						<TD class="ta_txt"><INPUT id="DownloadUserId" type="hidden" name="DownloadUserId" runat="server">
							<TEXTAREA class="BigStatic fl" id="DownloadUserName" name="DownloadUserName" rows="2" readOnly cols="50"
								runat="server"></TEXTAREA>
								<INPUT class="bnt_Add fl" style="width:50px; display:inline-table;" title="添加人员" onClick="user_select('DownloadUserId','DownloadUserName');" type="button" value="添加"
								name="button">
								<INPUT class="bnt_Del fl" style="width:50px; display:inline-table;" title="清空人员" onClick="clear_double('DownloadUserId','DownloadUserName');" type="button" value="清空"
								name="button">
								<br>有权限的人可以下载Office文档</TD>
					</TR>
					
					<TR>
						<TD class="ta_bg" noWrap>
                            管理权限：</TD>
						<TD class="ta_txt"><INPUT id="ManageUserId" type="hidden" name="ManageUserId" runat="server">
							<TEXTAREA class="BigStatic fl" id="ManageUserName" name="ManageUserName" rows="2" readOnly cols="50"
								runat="server"></TEXTAREA>
								<INPUT class="bnt_Add fl" style="width:50px; display:inline-table;" title="添加人员" onClick="user_select('ManageUserId','ManageUserName');" type="button" value="添 加"
								name="button">
								<INPUT class="bnt_Del fl" style="width:50px; display:inline-table;" title="清空人员" onClick="clear_double('ManageUserId','ManageUserName');" type="button" value="清 空"
								name="button"></TD>
					</TR>
					<TR align="center">
						<TD noWrap colSpan="2" class="bnt_con">
						    <table width="130" cellpadding="0" cellspacing="0" border="0" style="border:none;">
							  <tr>
							    <td align="left" style="border:none;"><INPUT class="BigButton" onClick="return CheckForm();" type="submit" value="确 定"></td>
								<td align="right" style="border:none;"><INPUT class="BigButton" onClick="location='index.aspx'" type="button" value="返 回"></td>
							  </tr>
							</table>				
						
						</TD>
					</TR>
				</TABLE>
				<SCRIPT language="javascript">
				if (<%=ViewState["Type"]%> == "1")
				{
					trDept.style.display='none';
					trUser.style.display='none';
				}
				else if(<%=ViewState["Type"]%> == "2")
				{
					trDept.style.display='';       
					trUser.style.display='none';
				}
				else if (<%=ViewState["Type"]%> == "3")
				{
					trDept.style.display='none';
					trUser.style.display='';
				}
				</SCRIPT>
			</asp:Panel>
			<asp:Literal id="litMessage" runat="server"></asp:Literal>
            </div>
		</form>
	</body>
</HTML>
